<template>
  <div class="login">
    <Header :leftArrow="false" :search="false" :border="false"/>
    <div class="login-content-wrapper">
      <div class="login-content">
        <h2 class="login_title">用户登陆</h2>
        <van-form @submit="onSubmit">
          <van-field
            v-model="phone"
            :rules="[{ pattern, required: true, message: '请填写正确的手机号' }]"
            name="phone"
            label="手机号"
            placeholder="请填写手机号"
          />
          <div class="footer_btn">
            <van-button round block type="info" native-type="submit">
              提交
            </van-button>
          </div>
        </van-form>
      </div>
    </div>
  </div>
</template>

<script>
import Header from '../../components/Header/NoLeftArrowHeader'
import { phoneReg } from './../../utils/validation_rule'

export default {
  name: 'Login',
  components: {
    Header
  },

  data() {
    return {
      phone: '13327571240',
      pattern: phoneReg
    }
  },
  mounted() {

  },
  methods: {
    onSubmit(values) {
      this.$router.replace({ path: '/' }).catch(() => {
      })
    }
  }
}
</script>

<style scoped lang="less">
@import "../../common/css/mixins.less";

.login {
  .login-content-wrapper {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-image: url("./images/bg.png");
    background-repeat: no-repeat;
    background-position: top left;
    background-size: 100% 100%;

    .login-content {
      height: 100%;
      padding: 46px 10px 0 10px;

      .login_title {
        font-size: 20px;
        font-weight: 500;
        color: #FFFFFF;
        text-align: center;
        padding-top: 85px;
        padding-bottom: 30px;
      }

      .footer_btn {
        padding-top: 16px;
        margin: 16px;
      }

    }
  }
}
</style>
